#import "NSMutableArray+SRAdditions.h"


@implementation NSMutableArray (NSMutableArraySRAdditions)

-(id)pop {
    id object = nil;
    if ([self count] > 0) {
        object = [self objectAtIndex:0];
        [self removeObjectAtIndex:0];
    }
    return object;    
}

-(void)push:(id)object {
    if (!object)
        return;
    [self insertObject:object atIndex:0];
}

-(id)peek {
    return [self count] > 0 ? [self objectAtIndex:0] : nil;
}

@end
